﻿using System;

namespace diantou.web.ajax.enterprise
{
    /// <summary>
    /// 考试编程题调用
    /// </summary>
    [fastCSharp.code.cSharp.ajax(IsPool = true)]
    class examProblem : examHandle<examProblem>
    {
        /// <summary>
        /// 购买独占题目
        /// </summary>
        /// <param name="id"></param>
        /// <param name="price"></param>
        /// <param name="onReturn"></param>
        public void SetEnterprise(int id, int price, Action<fastCSharp.net.returnValue<int>> onReturn)
        {
            if (currentUser.Permission == dataModel.user.permission.Admin || currentEnterprise.IsEnterprisePrivateValidity) diantou.examDataAccess.tcpCall.examProblem.setEnterprise(id, price, currentUser.Id, onReturn);
            else onReturn(0);
        }
    }
}
